home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / -archivi / -recent2 / amicad_2.00.lha / AmiCAD / ARexx / EditString.AmiCAD < prev    next >
Text File  |  1999-02-07  |  2KB  |  83 lines

  1. /* Édition du texte associé à un objet */
  2. /* $VER: 1.00 (© R.Florac, 6 Janvier 1999) */
  3.  
  4. options results
  5.  
  6. 'FIRSTSEL'; o=result
  7. if o=0 then do
  8.     'MESSAGE("Sélectionnez l''objet à éditer")'
  9.     exit
  10. end
  11.  
  12. 'TYPE('o')'; t=result
  13. select
  14.     when t=1 then do    /* composant */
  15.     'GETVAL('o')'; v=result
  16.     'GETREF('o')'; r=result
  17.     'PARTNAME('o')'; n=result
  18.     if r=0 then do
  19.         'ASKTEXT("Référence?","")'; t=result
  20.         if t="" then exit
  21.         'SAVEALL(-1):ROTATE(0,0):SYMMETRY(0,0)'
  22.         'GETPOS('o')'
  23.         if result=2 | result=4 then do
  24.         'WRITE("'t'",COL('o')+10,LINE('o'))'; r=result
  25.         end
  26.         else do
  27.         'WRITE("'t'",COL('o')+WIDTH('o')+9,LINE('o')+HEIGHT('o')/2)'; r=result
  28.         end
  29.         if r>0 then 'LINKREF('o','r')'
  30.         r=0
  31.     end
  32.     if v=0 then do
  33.         'ASKTEXT("Valeur/type?","")'; t=result
  34.         if t="" then exit
  35.         if n="RÉSISTANCE" then t=t||'8B'x       /* ajout signe ohm */
  36.         if r>0 then do
  37.         'SAVEALL(-1):ROTATE(0,0):SYMMETRY(0,0)'
  38.         end
  39.         'GETPOS('o')'
  40.         if result=2 | result=4 then do
  41.         'WRITE("'t'",COL('o')+10,LINE('o')+HEIGHT('o')+9)'; v=result
  42.         end
  43.         else do
  44.         'WRITE("'t'",COL('o')+WIDTH('o')+9,LINE('o')+HEIGHT('o')/2+10)'; v=result
  45.         end
  46.         if v>0 then 'LINKVAL('o','v')'
  47.     end
  48.     end
  49.     when t=4 then do    /* texte */
  50.     'ASKTEXT("Texte", READTEXT('o'))'; t=result
  51.     if t~="" then do
  52.         'SETTEXT('o',"'t'")'
  53.     end
  54.     end
  55.     when t=5 then do
  56.     'ASKTEXT("Référence", READTEXT('o'))'; t=result
  57.     if t~="" then do
  58.         'SETTEXT('o',"'t'")'
  59.     end
  60.     end
  61.     when t=6 then do
  62.     'ASKTEXT("Valeur/Type", READTEXT('o'))'; t=result
  63.     if t~="" then do
  64.         'SETTEXT('o',"'t'")'
  65.     end
  66.     end
  67.     when t=11 then do
  68.     'ASKTEXT("Connecteur d''entrée", READTEXT('o'))'; t=result
  69.     if t~="" then do
  70.         'SETTEXT('o',"'t'")'
  71.     end
  72.     end
  73.     when t=12 then do
  74.     'ASKTEXT("Connecteur de sortie", READTEXT('o'))'; t=result
  75.     if t~="" then do
  76.         'SETTEXT('o',"'t'")'
  77.     end
  78.     end
  79.     otherwise do
  80.     'MESSAGE("Objet incorrect")'
  81.     end
  82. end
  83.